import http from '@/utils/http'

//商品详情
export function goodsApi (id) {
  return http({
    url: '/goods',
    method: 'get',
    params: { id }
  })
}

//获取城市列表数据
export function getCityListApi () {
  return http({
    url: 'https://yjy-oss-files.oss-cn-zhangjiakou.aliyuncs.com/tuxian/area.json',
    method: 'get'
  })
}

//同类推荐
export function goodsRelevantApi (id, limit = 16) {
  return http({
    url: '/goods/relevant',
    method: 'get',
    params: {
      id,
      limit
    }
  })
}

//热销推荐
export function goodsHotApi (params) {
  return http({
    url: '/goods/relevant',
    method: 'get',
    params
  })
}

//商品评价信息
export function goodsEvaluateApi (id) {
  return http({
    url: `https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate`,
    method: 'get',
  })
}

//评论分页数据
export function goodsEvaluatePageApi (params) {
  return http({
    url: `https://mock.boxuegu.com/mock/1175/goods/${params.id}/evaluate/page`,
    method: 'get',
    params
  })
}


